/*
 * ExceptionHandler.h
 *
 *  Created on: Jan 29, 2012
 *      Author: hduser
 */

#ifndef EXCEPTIONHANDLER_H_
#define EXCEPTIONHANDLER_H_

#include<iostream>
#include "Logger.h"

using namespace std;
using namespace logging;

namespace utilities {

class ExceptionHandler {
public:
	ExceptionHandler();
	virtual ~ExceptionHandler();
	static int processException(exception* ex, char* location, char* note) {

		// handle exception

		// log exception to DB
		cout<< "in processException - " << ex->what() << endl;
		Logger* logger = new Logger();
		logger->logMessage("NULL", "NULL", "NULL", location, (char*)ex->what(), note);
		return 0;
	}

	static int processException(char* location, char* note) {

			// handle exception

			// log exception to DB
			cout<< "in processException - " << endl;
			Logger* logger = new Logger();
			logger->logMessage("NULL", "NULL", "NULL", location, "NULL", note);
			return 0;
		}
};

}

#endif /* EXCEPTIONHANDLER_H_ */
